package com.xlh.dao.course.helper;

import com.xlh.dao.course.TheoryLearnTimeStatisticsMapper;
import com.xlh.pojo.course.TheoryLearnTimeStatistics;
import com.xlh.pojo.course.example.TheoryLearnTimeStatisticsExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author cfz
 */
@Repository
public class TheoryLearnTimeMapperHelper {

    @Autowired
    private TheoryLearnTimeStatisticsMapper theoryLearnTimeStatisticsMapper;

    public List<TheoryLearnTimeStatistics> findByCondition(Long chapterId , List<Long> userIds){

        TheoryLearnTimeStatisticsExample theoryLearnTimeStatisticsExample = new TheoryLearnTimeStatisticsExample();
        theoryLearnTimeStatisticsExample.createCriteria().andChapterIdEqualTo(chapterId).andUserIdIn(userIds).andIsDeletedEqualTo(false);
        List<TheoryLearnTimeStatistics> theoryLearnTimeStatistics = theoryLearnTimeStatisticsMapper.selectByExample(theoryLearnTimeStatisticsExample);

        return theoryLearnTimeStatistics;
    }






}
